package com.lichuang.fruitvarietysm.cart.feign;

import com.lichuang.fruitvarietysm.cart.feignEntity.Goods;
import com.lichuang.fruitvarietysm.cart.feignEntity.GoodsSkuAttr;
import com.lichuang.fruitvarietysm.cart.feignEntity.Goodssku;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Repository
@FeignClient(value = "goods")
public interface GoodSkuMapper {

    /**
     * 根据商品id获取全部商品信息
     * @param goodsId
     * @return
     */
    @RequestMapping("goods/getGoods")
    public Goods getGoods(@RequestParam("goodsId")Integer goodsId);

    /**
     * 根据商品id查商品是否有sku的值
     * @param goods_id
     * @return
     */
    @RequestMapping("goodssku/getSkuCount")
    public int getSkuCount(@RequestParam("goods_id") Integer goods_id);

    /**
     * 根据skuValue的值，获取对应的skuId  ->(GoodsController)
     * @param goods_id
     * @param skuValue
     * @return
     */
     @RequestMapping("goods/getSku")
     Goodssku getSku(@RequestParam("goods_id")Integer goods_id,@RequestParam("skuValue")String skuValue);

    /**
     * 根据skuId获取sku的全部信息
     * @param skuId
     * @return
     */
    @RequestMapping("goodssku/getSku")
    public Goodssku getSkuBySkuId(@RequestParam("skuId")Integer skuId);


    /**
     * 根据商品id，查对应的属性
     * @param goods_id
     * @return
     */
    @RequestMapping("goods-sku-attr/sSkuAttribute")
    List<GoodsSkuAttr> getSkuAttribute(@RequestParam("goods_id")Integer goods_id);
    /**
     * 根据id，查找对应的属性值
     * @param id
     * @return
     */
    @RequestMapping("goods-sku-attr/getSkuValue")
    public GoodsSkuAttr getSkuValue(@RequestParam("id")Integer id);


    /**
     * 通过skuId来拿到具体的属性和值
     * @param skuId
     * @return
     */
    @RequestMapping("goodssku/getSkuText")
    public List<List> getSkuText(@RequestParam("skuId") Integer skuId);
}
